package com.liveinstars.im.endpoint;

import com.liveinstars.api.im.BadWordRecognizeService;
import com.liveinstars.api.im.vo.WordBadLevel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
public class BadWordRecognizeApiEndPoint implements BadWordRecognizeService {

    @Autowired
    @Qualifier("badWordRecognizeApiServiceApiImpl")
    BadWordRecognizeService badWordRecognizeService;


    @Override
    public WordBadLevel getWordBadLevel(@RequestBody Map params) {
        return badWordRecognizeService.getWordBadLevel(params);
    }

    @Override
    public String getBadWordList() {
        return badWordRecognizeService.getBadWordList();
    }

    @Override
    public String addOrDeleteBadWord(@RequestParam(value = "word", required = false) String word, @RequestParam(value = "type", required = false) String type) {
        return badWordRecognizeService.addOrDeleteBadWord(word, type);
    }
}
